using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Text = TMPro.TMP_Text;

public class UIFoodItem : MonoBehaviour {
	public GameObject container;
	public ItemId itemId;
	public Text[] itemCntText;

	public void Update() {
		var cnt = PlayerProp.Instance.inventory.GetValueOrDefault(itemId);
		container.SetActive(cnt > 0);
		for (int i = 0; i < itemCntText.Length; i++) {
			if (itemCntText[i] != null) {
				itemCntText[i].text = $"x{cnt}";
			}
		}
	}
}
